package net.lzzy.practices;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @author m
 */
@Configuration
@EnableOpenApi
public class SwaggerConfig {
    private ApiInfo apiInfo(){
        return  new ApiInfoBuilder().description("本接口纯纯")
                .title("practices接口文档1.0").contact(new Contact("lzzy.retry","https://mooc1.chaoxing.com/course/247428660.html","214583045@qq.com"))
                .version("v1.0").build();
    }
    @Bean
    public Docket docket(){

        return new Docket(DocumentationType.OAS_30)
                .apiInfo(apiInfo())
                .enable(true)
                .select()
                .apis(RequestHandlerSelectors.basePackage("net.lzzy.practices.web"))
                .paths(PathSelectors.any()).build();
    }

}
